<?php
session_start();

include("DBConnection.php");

if( $_POST['delete'] == 1 ){
	//Thema archivieren
	$sql = "Update F_Forum Set UnterID=5 Where ID=".$_POST['kategorie'];
	mysql_query($sql) or die("Abfrage Fehler: ".$sql);

	$_SESSION['kategorie']=$_GET['kategorie'];
	include("forum.php");
}else{
	//soll wirklich ins Archiv verschoben werden?

	$sql = 'Select Thema From F_Forum  Where ID ='.$_POST['kategorie'];
	$result = mysql_query($sql) or die("Abfrage Fehler: ".$sql);
	$r = mysql_fetch_array($result, MYSQL_ASSOC);

	echo "<BR>";
	echo "Soll das Thema:<B>".$r['Thema']."</B> wirklich ins Archiv verschoben werden?<BR>";

	echo "<Form Action='forum_thread_delete.php?f_id=".$_POST['kategorie']."' Method='Post'>";

	echo "<Input Type='hidden' name='kategorie' value='".$_POST['kategorie']."'>";	
	echo "<INPUT Type='hidden' name='delete' value='1'>";
	echo "<Input Type='submit' Value='Ja Thread in Papierkorb verschieben'>";
	echo "<Input Type='button' Value='Nein'>";	

	echo "</Form>";

}

?>